import request from "@/sheep/request";

export default {
  //借支列表
  postBorrowingIndex: (params) =>
    request({
      url: 'api/borrowing/index',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: true,
        loadingMsg: '加载中',
        auth: true,
      },
      params,
    }),
    // 借支申请
    getBorrowingAdd: (data) =>
    request({
      url: 'api/borrowing/add',
      method: 'GET',
      custom: {
        showSuccess: true,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      data,
    }),
     // 借支详情
    getBorrowingView: (params) =>
    request({
      url: 'api/borrowing/view',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: true,
        loadingMsg: '加载中',
        auth: true,
      },
      params,
    }),
 	//借支审核列表
     getBorrowingApproveList: (params) =>
     request({
         url: 'api/borrowing/approve_list',
         method: 'GET',
         params,
         custom: {
            showSuccess: false,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: true,
            loadingMsg: '加载中',
            auth: true,
         },
     }),
     	//借支审核通过
	getBorrowingPass: (params) =>
    request({
        url: 'api/borrowing/pass',
        method: 'GET',
        params,
        custom: {
            showSuccess: true,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),
//借支审批拒绝
getBorrowingRefuse: (params) =>
    request({
        url: 'api/borrowing/refuse',
        method: 'POST',
        params,
        custom: {
            showSuccess: true,
            successMsg: '',
            showError: true,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
        },
    }),
    //回款账户
getReturnedInfo: (params) =>
    request({
      url: 'api/returned_info/index',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params,
    }),

    // 用户端借支列表
    postBorrowingProjectIndex: (params) =>
      request({
        url: 'api/borrowing_project/index',
        method: 'POST',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: true,
          loadingMsg: '加载中',
          auth: true,
        },
        params,
      }),
      // 用户端借支申请
      getBorrowingProjectAdd: (data) =>
      request({
        url: 'api/borrowing_project/add',
        method: 'GET',
        custom: {
          showSuccess: true,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        data,
      }),
       // 用户端借支详情
      getBorrowingProjectView: (params) =>
      request({
        url: 'api/borrowing_project/view',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: true,
          loadingMsg: '加载中',
          auth: true,
        },
        params,
      }),
     //用户端借支审核列表
       getBorrowingProjectApproveList: (params) =>
       request({
           url: 'api/borrowing_project/approve_list',
           method: 'GET',
           params,
           custom: {
              showSuccess: false,
              successMsg: '',
              showError: true,
              errorMsg: '',
              showLoading: true,
              loadingMsg: '加载中',
              auth: true,
           },
       }),
         //用户端借支审核通过
    getBorrowingProjectPass: (params) =>
      request({
          url: 'api/borrowing_project/pass',
          method: 'GET',
          params,
          custom: {
              showSuccess: true,
              successMsg: '',
              showError: true,
              errorMsg: '',
              showLoading: false,
              loadingMsg: '加载中',
              auth: true,
          },
      }),
  //用户端借支审批拒绝
  getBorrowingProjectRefuse: (params) =>
      request({
          url: 'api/borrowing_project/refuse',
          method: 'POST',
          params,
          custom: {
              showSuccess: true,
              successMsg: '',
              showError: true,
              errorMsg: '',
              showLoading: false,
              loadingMsg: '加载中',
              auth: true,
          },
      }),
};
